<?php
// +----------------------------------------------------------------------
// | 品达网络 [ 品质保证，助企腾达 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.pdwl.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 萧涩啊 <wangmode@163.com>
// +----------------------------------------------------------------------
namespace app\models;


use think\Model;

class BaseModel extends Model
{
    private static $errorMsg;
    const DEFAULT_ERROR_MSG = '操作失败,请稍候再试!';

    /**
     * 设置错误信息
     * @param string $errorMsg
     * @return bool
     */
    protected static function setErrorInfo($errorMsg = self::DEFAULT_ERROR_MSG)
    {
        self::$errorMsg = $errorMsg;
        return false;
    }

    /**
     * 获取错误信息
     * @param string $defaultMsg
     * @return string
     */
    public static function getErrorInfo($defaultMsg = self::DEFAULT_ERROR_MSG)
    {
        return !empty(self::$errorMsg) ? self::$errorMsg : $defaultMsg;
    }

}
